/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package merlion.crm.slcm.pojo;

import java.io.Serializable;
import merlion.mrp.ppm.entity.Product;

/**
 *
 * @author Kenn
 */
public class PriceAnalysis implements Serializable {
    
    private Product product;
    private Double memberDiscount;
    private Double orderDiscount;
    private Double specialDiscount;
    private Double tax;
    private Double netPriceDS;
    private Double netPriceWS;
    private Double profitDS;
    private Double profitWS;
    private Double profitMarginDS;
    private Double profitMarginWS;

    public PriceAnalysis(Product product, Double memberDiscount, Double orderDiscount, Double specialDiscount, Double tax) {
        this.product = product;
        this.memberDiscount = memberDiscount;
        this.orderDiscount = orderDiscount;
        this.specialDiscount = specialDiscount;
        this.tax = tax;
        this.netPriceDS = (1d + tax)*(product.getDsUnitPrice() * (1d - memberDiscount) * (1d - orderDiscount) * (1d - specialDiscount));
        this.netPriceWS = (1d + tax)*(product.getWsUnitPrice() * (1d - memberDiscount) * (1d - orderDiscount) * (1d - specialDiscount));
        this.profitDS = netPriceDS - product.getBasePrice().doubleValue();
        this.profitWS = netPriceWS - product.getBasePrice().doubleValue();
        this.profitMarginDS = profitDS / product.getBasePrice().doubleValue();
        this.profitMarginWS = profitWS / product.getBasePrice().doubleValue();
    }

    public Double getMemberDiscount() {
        return memberDiscount;
    }

    public void setMemberDiscount(Double memberDiscount) {
        this.memberDiscount = memberDiscount;
    }

    public Double getNetPriceDS() {
        return netPriceDS;
    }

    public void setNetPriceDS(Double netPriceDS) {
        this.netPriceDS = netPriceDS;
    }

    public Double getNetPriceWS() {
        return netPriceWS;
    }

    public void setNetPriceWS(Double netPriceWS) {
        this.netPriceWS = netPriceWS;
    }

    public Double getOrderDiscount() {
        return orderDiscount;
    }

    public void setOrderDiscount(Double orderDiscount) {
        this.orderDiscount = orderDiscount;
    }

    public Product getProduct() {
        return product;
    }

    public void setProduct(Product product) {
        this.product = product;
    }

    public Double getSpecialDiscount() {
        return specialDiscount;
    }

    public void setSpecialDiscount(Double specialDiscount) {
        this.specialDiscount = specialDiscount;
    }

    public Double getTax() {
        return tax;
    }

    public void setTax(Double tax) {
        this.tax = tax;
    }

    public Double getProfitDS() {
        return profitDS;
    }

    public void setProfitDS(Double profitDS) {
        this.profitDS = profitDS;
    }

    public Double getProfitMarginDS() {
        return profitMarginDS;
    }

    public void setProfitMarginDS(Double profitMarginDS) {
        this.profitMarginDS = profitMarginDS;
    }

    public Double getProfitMarginWS() {
        return profitMarginWS;
    }

    public void setProfitMarginWS(Double profitMarginWS) {
        this.profitMarginWS = profitMarginWS;
    }

    public Double getProfitWS() {
        return profitWS;
    }

    public void setProfitWS(Double profitWS) {
        this.profitWS = profitWS;
    }
}
